<%= form_for(blog) do |f| %>
  <% if blog.errors.any? %>
    <% blog.errors.full_messages.each do |error| %>
      <%= alert_generator error %>
    <% end %>
  <% end %>

  <div class="form-group">
    <%= f.text_field :title, class: 'form-control', placeholder: "Title" %>
  </div>

  <div class="form-group">
    <%= f.label :topic_id %>
    <%= f.collection_select(:topic_id, Topic.all, :id, :title,
                              {
                                include_blank: true
                              },
                              class: 'form-control'
                            )
    %>
  </div>

  <div class="form-group">
    <%= f.radio_button :status, 'draft' %>
    <%= f.label :status, 'Draft' %>

    <%= f.radio_button :status, 'published' %>
    <%= f.label :status, 'Published' %>
  </div>

  <div class="form-group">
    <%= f.text_area :body, class: 'form-control', rows: 15, placeholder: "Content" %>
  </div>

  <div class="form-group">
    <%= f.submit "Submit", class: 'btn btn-primary' %>
  </div>
<% end %>